//
//  WCValidFileTextFieldCell.m
//  WabbitCode
//
//  Created by William Towe on 4/5/09.
//  Copyright 2009 Revolution Software. All rights reserved.
//

#import "WCValidFileTextFieldCell.h"
#import "NSAttributedString+WCExtensions.h"


@implementation WCValidFileTextFieldCell
- (id)copyWithZone:(NSZone *)zone {
	WCValidFileTextFieldCell *copy = [super copyWithZone:zone];
	
	copy->_isFileValid = _isFileValid;
	
	return self;
}

- (void)drawInteriorWithFrame:(NSRect)frame inView:(NSView *)view; {
	// draw the string in red if we aren't valid
	if (!_isFileValid) {
		/*
		NSMutableAttributedString *string = [[[self attributedStringValue] mutableCopy] autorelease];
		
		[string addAttribute:NSForegroundColorAttributeName value:[NSColor colorWithCalibratedRed:0.5 green:0.0 blue:0.0 alpha:1.0] range:[string wholeRange]];
		
		// add a bold font if we in a table view using the source list style
		if ([view respondsToSelector:@selector(selectionHighlightStyle)] &&
			[(NSTableView *)view selectionHighlightStyle] == NSTableViewSelectionHighlightStyleSourceList) {
			
			[string addAttribute:NSFontAttributeName value:[NSFont boldSystemFontOfSize:[NSFont systemFontSizeForControlSize:[self controlSize]]] range:[string wholeRange]];
		}
		
		[self setAttributedStringValue:string];
		 */
	}
	[super drawInteriorWithFrame:frame inView:view];
}

@synthesize isFileValid=_isFileValid;
@end
